package com.tecode.day01.homeword;

import java.util.Scanner;

public class TestUser {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		User u = new User();

		u.id = 1001;
		u.pwd = "j55";
		u.balance = 100;

		// 对账号的操作
		while (true) {
			System.out.println("请输入选择的功能");
			System.out.println("1 查询   2 存钱  3 取钱  4 修改密码   ");
			int nums = sc.nextInt();

			switch (nums) {
			case 1:
				System.out.println("账号余额为："+u.show());
				break;
			case 2:
				System.out.println("请输入存款金额：");
				double saveMoney = sc.nextDouble();
				u.saveMoney(saveMoney);
				
				break;
			case 3:
				System.out.println("请输入取款金额：");
				double catchMoney = sc.nextDouble();
				u.catchMoney(catchMoney);
				break;
			case 4:
					System.out.println("请输入原始密码：");
					String oldPwd = sc .next();
					System.out.println("请输入新密码：");
					String newPwd = sc .next();
					
					u.changePassword(oldPwd, newPwd);
				break;
			default:
				System.out.println("选择有错误。。。");
				break;
			}

		}

	}
}
